home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
doom
/
suckmods.zip
/
SUCKMODS.ZIP
/
suck05
/
src
/
ghostdaemon.qc
< prev
next >
Wrap
Text File
|
1997-05-09
|
1KB
|
37 lines
// Code to get rid of ghost players which take up spaces on the server.
// Brought to you courtesy of Suck. Sends comments and questions to
// suck@linux.mit.edu
void() ghost_daemon_think =
{
local entity p;
p=find(world, classname, "player");
while (p!=world)
{
// Unconnected players _do_ run PlayerPreThink, but
// Quake doesn't clear the player structure after
// a player leaves, so we have to see if a player
// hasn't thought in a while. If so, clear his
// thought_count for new players who will join
// and use the same player structure
if ((p.last_thought+1)<time)
p.thought_count=0;
if (p.netname == "unconnected")
{
// When you join a game, your name is initially
// set to unconnected for a few cycles. Therefore,
// we cannot blindly kick players named unconnected.
// Instead, we have to kick players named unconnected
// who have been thinking for a while, because
// unconnected players do keep thinking.
if (p.thought_count>100)
localcmd("kick unconnected\n");
}
p=find(p, classname, "player");
}
self.nextthink=time+0.3;
};